﻿using System;
using System.Collections.Generic;
using System.Text;

using Northwind.NET.FE.Forms;
using Northwind.NET.FE.Reports;
using Northwind.NET.Utilities;

namespace Northwind.NET.FE
{
    public partial class FrontEndNavigator
    {
        /// <summary>
        /// Switchboard form instance
        /// </summary>
        public static MainSwitchboardForm MainSwitchboardForm;

        /// <summary>
        /// Opens Switchboard form
        /// </summary>
        public void OpenMainSwitchboard()
        {
            if (MainSwitchboardForm == null)
                MainSwitchboardForm = new MainSwitchboardForm();
            MainSwitchboardForm.Show();
        }
        public void UnhideMainSwitchboard()
        {
            if (MainSwitchboardForm == null)
            {
                OpenMainSwitchboard();
            }
            else
            {
                MainSwitchboardForm.Visible = true;
            }
        }

        public void OpenOrdersForm()
        {
            OrdersForm form = new OrdersForm();
            form.Show();
        }

        public void OpenProductsForm()
        {
            ProductsForm form = new ProductsForm();
            form.Show();
        }

        public void OpenSuppliersForm()
        {
            SuppliersForm form = new SuppliersForm();
            form.Show();
        }

        public void OpenSalesByCategoryReport()
        {
            SalesByCategoryReport form = new SalesByCategoryReport();
            form.Show();
        }
        public void OpenSalesByCategoryReport(string categoryId)
        {
            SalesByCategoryReport form = new SalesByCategoryReport();
            form.Show();
            form.RefreshForCategory(categoryId);  
        }

        public void OpenSalesTotalsByAmountReport()
        {
            SalesTotalsByAmountReport form = new SalesTotalsByAmountReport();
            form.Show();
        }

        public void OpenEmployeeSalesByCountryReport()
        {
            EmployeeSalesByCountryReport form = new EmployeeSalesByCountryReport();
            form.Show(); 
        }

    }
}
